{% autoescape off %}
<table
  {% if table.id %}
    id="{{ table.id }}"
  {% endif %}
  {% if table.cls %}
    class="{{ table.cls }}"
  {% endif %}
  >
  <thead>
    <tr>
      {% for column in table.columns %}
      <th title='{{ column.desc }}'
        style='
        {% if column.center %} text-align: center; {%endif %}
        {% if column.divider %} border-right-width: 2px; {%endif %}
        '>{{ column.title }}</th>
      {% endfor %}
    </tr>
  </thead>
  <tbody>
    {% for row in table.rows %}
    <tr class="row_{{ forloop.counter }}">
      {% with forloop.counter0 as row_counter %}
      {% for entry, column in row %}
      {% if row_counter|divisibleby:column.rowspan %}
      <td rowspan="{{ column.rowspan }}"
        style='
        {% if column.center %} text-align: center; {%endif %}
        {% if column.divider %} border-right-width: 2px; {%endif %}
        '>{{ entry }}</td>
      {% endif %}
      {% endfor %}
      {% endwith %}
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endautoescape %}

